﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NetFrameworkExtensions.Collections;

namespace NetFrameworkExtensions.DataLayer
{
  public interface IDataRepository
  {
    object New();

    object Insert(object data);

    object Update(object data);

    bool DeleteById(object identifier);

    object GetById(object identifier);

    IItemsPage GetData(object filter);

    object NewFilter();
  }

  public interface IDataRepository<TIdentified, TIdentifier, TFilter> :
    IDataRepository
    where TIdentified : class, IIdentifiedData<TIdentified, TIdentifier>
    where TIdentifier : global::System.IEquatable<TIdentifier>
    where TFilter : class, IDataFilter
  {
    new TIdentified New();

    TIdentified Insert(TIdentified data);

    TIdentified Update(TIdentified data);

    bool DeleteById(TIdentifier identifier);

    TIdentified GetById(TIdentifier identifier);

    IItemsPage<TIdentified> GetData(TFilter filter);

    new TFilter NewFilter();
  }
}
